/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package session;

import entity.Accessory;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author Declan
 */
@Stateless
public class AccessoryFacade extends AbstractFacade<Accessory> {
    @PersistenceContext(unitName = "PhoneShopPU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public AccessoryFacade() {
        super(Accessory.class);
    }

    public List queryByManufacturerMakeType(String name){
        Query query = this.getEntityManager().createNamedQuery("findAccessoryByManufacturerMakeType");
        query.setParameter("entry", name);
        return query.getResultList();
    }

}
